<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
	<#assign base=request.contextPath  />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta name="misapplication-tap-highlight" content="no" />
		<meta name="HandheldFriendly" content="true" />
		<meta name="MobileOptimized" content="320" />
		<title>桩企加盟</title>
		<link rel="stylesheet" type="text/css" href="${base}/Yang/layui/css/layui.css"/>
		<link rel="stylesheet" href="${base}/css/common.css" type="text/css" charset="utf-8" />
		<script src="${base}/Yang/layui/layui.js"></script>
		<script src="${base}/Yang/jquery-1.9.0.min.js"></script>
		<style type="text/css">
			.layui-input, .layui-select, .layui-textarea {
			    height: 38px;
			    line-height: 1.3;
			    line-height: 38px\9;
			    border-width: 1px;
			     border-style: none; 
			    background-color: #fff;
			    border-radius: 2px;
			}
			.layui-form-item{
				border-bottom: 2px solid #CCCCCC;
			}
			.layui-form-select dl dd.layui-this {
			    background-color: #9AC747;
			    color: #fff;
			}
			.layui-input{
				width: 200px;
			}
			.layui-form-label{
				width: 115px;
			 }
			.content {
				text-align: center;
				padding-top: 0px;
			}
			.layui-btn{
				border-radius: 5px;
			}
		</style>
	</head>

	<body onselectstart="return false;">
	<div id="content" class="content">
		<form class="layui-form" action="">
		  <div class="layui-form-item">
		    <label class="layui-form-label">企业名称</label>
		    <div class="layui-input-block">
		      <input type="text" id="enterprisen" name="企业名称" lay-verify="企业名称" autocomplete="off" placeholder="请输入企业名称" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">联系人姓名</label>
		    <div class="layui-input-block">
		      <input type="text" id="name" name="联系人姓名" lay-verify="联系人姓名" autocomplete="off" placeholder="请输入联系人姓名" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">联系人手机</label>
		    <div class="layui-input-block">
		      <input  type="text" id="phone" name="联系人手机" lay-verify="联系人手机" autocomplete="off" placeholder="请输入联系人手机" class="layui-input">
		    </div>
		  </div>
		

		  <div class="layui-form-item">
		    <label class="layui-form-label">桩点位置</label>
		    <div class="layui-input-block">
		      <input type="text" id="position" name="桩点位置" lay-verify="桩点位置" autocomplete="off" placeholder="请输入桩点位置" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">桩点数量</label>
		    <div class="layui-input-block">
		      <input  type="text" id="loading" name="桩点数量" lay-verify="桩点数量" autocomplete="off" placeholder="请输入桩点数量" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">桩体功率</label>
		    <div class="layui-input-block">
		      <input  type="text" id="power" name="桩体功率" lay-verify="桩体功率" autocomplete="off" placeholder="请输入桩体功率" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">适合车型</label>
		    <div class="layui-input-block">
		      <select name="" id="carType">
                  <option value=""></option>
                  <option value="小面">小面</option>
                  <option value="中面">中面</option>
                  <option value="物流车">物流车</option>
                  <option value="私家车">私家车</option>
			  </select>
		    </div>
		   </div>
			<p style="font-size: 12px;">以上信息仅供集充充工作人员可见,请放心填写</p><br/>
		    <div class="foot">
		    <a href="#" onclick="sub()" class="layui-btn " lay-submit="" lay-filter="demo1"style="width: 45%;background-color: #9AC747">确定</a>
		    <button type="reset" class="layui-btn layui-btn-primary"style="width: 45%;">重置</button>
			</div>
		</form>
	</div>

<script type="text/javascript">
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate;
    });
	function sub(){
        var formData={};
        formData.enterprisen=$("#enterprisen").val();
        formData.name=$("#name").val();
        formData.phone=$("#phone").val();
        formData.position=$("#position").val();
        formData.loading=$("#loading").val();
        formData.power=$("#power").val();
        formData.logistics=$("#carType").val();
        $.ajax({
            type: "POST",
            data:{param:JSON.stringify(formData)},
            url: "${base}/chargeAdd/chargeAdd",
            success: function (data) {
                if (data===true){
                    alert("添加成功")
                    window.location.href="${base}/chargeAdd/success.html"
                }else{
                    alert("添加失败")
                }
            }

        });
	}

</script>
	</body>
</html>